using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PreloadingLevel : MonoBehaviour
{
	[Serializable]
	public struct PositionCars
	{
		public Vector3 pos;

		public Quaternion rot;

		public string nameCars;
	}

	public GameObject pointCar;

	public string namePrefab = "LODsystem-level1_winter";

	public List<PositionCars> listCarsOnScene = new List<PositionCars>();

	public Transform parentForCars;

	private void Awake()
	{
	}

	private IEnumerator PutAllCars()
	{
		foreach (PositionCars element in listCarsOnScene)
		{
			GameObject tmp = UnityEngine.Object.Instantiate(Resources.Load<GameObject>("Cars/" + element.nameCars));
			tmp.transform.position = element.pos;
			tmp.transform.rotation = element.rot;
			tmp.transform.parent = parentForCars;
			EntityBehavior entity = tmp.GetComponent<EntityBehavior>();
			entity.initialPosition = element.pos;
			entity.initialRotation = element.rot;
			yield return null;
		}
	}
}
